import request from '@/utils/request'

export function getInfo(query) {
  return request({
    url: '/andon/problems/page',
    method: 'get',
    params: query
  })
}

export function getProblemsStateStat(query) {
  return request({
    url: '/andon/problems/stat/status',
    method: 'get',
    params: query
  })
}

export function getProblemsTypeStat(query) {
  return request({
    url: '/andon/problems/stat/type',
    method: 'get',
    params: query
  })
}

export function getProblemsTeamGroupStat(query) {
  return request({
    url: '/andon/problems/stat/team-group',
    method: 'get',
    params: query
  })
}

export function getProblemsLineStat(query) {
  return request({
    url: '/andon/problems/stat/line',
    method: 'get',
    params: query
  })
}
export function getAndon_group(query) {
  return request({
    url: '/andon_group',
    method: 'get',
    params: query
  })
}
export function createAndon_group(data) {
  return request({
    url: '/andon_group',
    method: 'post',
    data
  })
}
export function delAndon_group(id) {
  return request({
    url: `/andon_group/delete/${id}`,
    method: 'post'
  })
}
export function updataAndon_group(id, data) {
  console.log(id, data)
  return request({
    url: `/andon_group/${id}/members`,
    method: 'post',
    data
  })
}
export function updataGroup_name(id, data) {
  console.log(id, data)
  return request({
    url: `/andon_group/${id}`,
    method: 'post',
    data
  })
}

export function member(id, type) {
  return request({
    url: `/andon_group/${id}/${type}`,
    method: 'get'
  })
}
export function questionType(query) {
  return request({
    url: `/andon/data/resolve/list`,
    method: 'get',
    params: query
  })
}

export function typeList(query) {
  return request({
    url: `/andon/data/type/list`,
    method: 'get',
    params: query
  })
}
export function reasonList(query) {
  return request({
    url: `/andon/data/reason/list`,
    method: 'get',
    params: query
  })
}

export function daylist(query) {
  return request({
    url: `/andon/data/day/list`,
    method: 'get',
    params: query
  })
}
export function linelist(query) {
  return request({
    url: `/andon/data/line/list`,
    method: 'get',
    params: query
  })
}
export function monthlist(query) {
  return request({
    url: `/andon/data/month/list`,
    method: 'get',
    params: query
  })
}
export function getabnormal(id) {
  return request({
    url: `/andon/abnormal/${id}`,
    method: 'get'
  })
}
export function putabnormal(data) {
  return request({
    url: `/andon/abnormal`,
    method: 'post',
    data
  })
}
export function shenPiList(query) {
  return request({
    url: `/andon/abnormal/page`,
    method: 'get',
    params: query
  })
}
export function shenPiConfirm(data) {
  return request({
    url: `/andon/abnormal/check`,
    method: 'put',
    data
  })
}
export function gettype(query) {
  return request({
    url: `/andon_problem/type/page`,
    method: 'get',
    params: query
  })
}
export function datalist(query) {
  return request({
    url: `/andon/data/day/orderbytime/list`,
    method: 'get',
    params: query
  })
}
export function addChecker(data) {
  return request({
    url: `/andon/abnormal/checker/add`,
    method: 'post',
    data: data
  })
}
export function deleteChecker(data) {
  return request({
    url: `/andon/abnormal/checker/delete`,
    method: 'delete',
    data
  })
}
export function checker(query) {
  return request({
    url: `/andon/abnormal/checker/list`,
    method: 'get',
    params: query
  })
}
export function examine(data) {
  return request({
    url: `/andon/abnormal/checker/`,
    method: 'post',
    data: data
  })
}
export function deleteDan(id) {
  return request({
    url: `/andon/abnormal/${id}`,
    method: 'delete'

  })
}
export function getAllUser() {
  return request({
    url: '/users/getAll',
    method: 'get'
  })
}
